package com.ruoyi.quartz.task;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ruoyi.system.service.IWeatherService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 天气更新任务
 */
@Component("weatherTask")
public class WeatherTask {
    private static final Logger log = LoggerFactory.getLogger(WeatherTask.class);

    @Autowired
    private IWeatherService weatherService;

    /**
     * 更新天气数据
     */
    public void updateWeatherData() {
        log.info("开始执行定时天气数据更新任务");
        weatherService.updateWeatherData();
    }
} 